﻿<span style="display:none"></span><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleListPage.aspx.cs" Inherits="iSun.Web.SysPage.SampleListPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../dojo-release-1.7.2-src/dojo/resources/dojo.css" rel="stylesheet" type="text/css" />
    <link href="../dojo-release-1.7.2-src/dojox/grid/resources/claroGrid.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="../dojo-release-1.7.2-src/dijit/themes/claro/document.css" />
    <link rel="stylesheet" href="../dojo-release-1.7.2-src/dijit/themes/claro/claro.css" />
       <!-- required: dojo.js -->
    <script type="text/javascript" src="../dojo-release-1.7.2-src/dojo/dojo.js" data-dojo-config="parseOnLoad: true, async:true"></script>
    <style type="text/css">
        #grid
        {
            height:100%;
        }
    </style>
<script type="text/javascript">
        var grid, store, dataStore,_data; //用于dojo.common.list.base.js
        var _cells = [<%=DojoDataFields %>];
        var _ViewStructure = [
			  {
			      noscroll: false,
			      defaultCell: { width: "100px" },
			      cells:_cells 
			  }
			];          //列表结构
        debugger
        var _dataJSON = "treeview.xhjson?entity=<%=EntityName %>";
         require([
				"dojo/_base/xhr"
			], function (xhr) {
			    xhr.get({
			        url: _dataJSON,
			        handleAs: "json"
			    }).then(function (data) {
			        _data=data;
			    });
			});

//        require(["dojo/store/Memory",
//				"dojo/data/ObjectStore",
//				//"dojo/_base/xhr",
//                "dojo/data/ItemFileWriteStore",
//                "dojox/grid/EnhancedGrid",
////                "dojox/grid/enhanced/plugins/Pagination",
////                "dojox/grid/enhanced/plugins/NestedSorting",
////                "dojox/grid/cells",
////                "dojox/grid/_CheckBoxSelector",
//				"dojo/domReady!"
//			], function (EnhancedGrid, Memory, ObjectStore, xhr) {
//                debugger
//               
////			    xhr.get({
////			        url: _dataJSON,
////			        handleAs: "json"
////			    }).then(function (data) {
//			        //alert("");
//			        //store = new Memory({ data: data.items });
//			        // dataStore = new ObjectStore({ objectStore: store });
//			        grid = new dojox.grid.EnhancedGrid({
//			            jsid: "grid",
//			            refresh: function () {
//			                var oThis = this;
//                            oThis.data=_data;
//                            //oThis.setData(_data);
//			                oThis.setStore(new dojo.data.ItemFileWriteStore({
//			                    url: _dataJSON,
//			                    handleAs: "json"
//			                }));
//			            },
//			            structure: _ViewStructure,
//			            columnReordering: true,
//			            rowsPerPage: "20"
//			        });

//			        // since we created this grid programmatically, call startup to render it
//			         
//                    grid.refresh();
//                    grid.startup();
//			        grid.set("onCellClick", function (e) {//点击事件
//			            var item = grid.getItem(e.rowIndex);
//			            store = grid.store,
//                        name = store.getValue(item, "id"),
//                        datasourceCell = 3, //数据源
//                        collectCell = 4, //采集
//                        ri = e.rowIndex, //点击的行号
//                        ci = e.cellIndex, //点击的列号


//                        item = grid.getItem(ri);

//			        });

//			    //});
//			});
       

    </script>
</head>
<body class="claro">
    <div id="grid" ></div>
</body>
</html>
